TimePunch User Group Service
The user group service allows grouping of employee profiles. Thus, employees can be grouped together for teams, departments, and offices.
CreateUserGroup
This method creates a new group and returns it. It is important that the group not yet gets stored to the database. This happens only when the group is saved.
UserGroupDto CreateUserGroup(
out TpFault fault,
TpAuthentication authentication,
GroupType groupType);
Needed Permission | userGroups@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
groupType | Type of the user group that shall be created (e.g. Team, Department, Branch) | |
Return value | Returns the created user group |
DeleteUserGroups
This method clears the passed user groups. The members of the group will not be associated any other group.
void DeleteUserGroups(
out TpFault fault,
TpAuthentication authentication,
Guid[] userGroupIds);
Needed Permission | userGroups@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userGroupIds | List that contains all user group ids that shall be deleted. | |
Return value | - |
ImportUserGroupAssignments
This method imports the passed group memberships. In contrast to the save method, the ID and not the common name of the group is important.
UserGroupMemberDto[] ImportUserGroupAssignments(
out TpFault fault,
TpAuthentication authentication,
GroupType groupType,
UserGroupMemberDto[] groupAssignments);
Needed Permission | userGroups@import | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
groupType | Type of the user group for which the group assignments shall be imported | |
groupAssignments | User Group assignments to import | |
Return value | - |
LoadUserGroup
This method loads the group with the specified ID and returns it.
UserGroupDto LoadUserGroup(
out TpFault fault,
TpAuthentication authentication,
Guid userGroupId);
Needed Permission | userGroups@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userGroupId | Id of the user group to load | |
Return value | Returns the loaded user group |
SaveUserGroup
This method saves the user group in the database. It is important that if the group members in the object are NULL, only the basic data of the Group gets stored.
UserGroupDto SaveUserGroup(
out TpFault fault,
TpAuthentication authentication,
UserGroupDto userGroup);
Needed Permission | userGroups@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userGroup | The user group to save | |
Return value | Returns the persisted user group |
SaveUserGroupAssignments
This method saves the group membership of employee profiles to the given group.
void SaveUserGroupAssignments(
out TpFault fault,
TpAuthentication authentication,
UserGroupSaveMemberDto[] groupAssignments);
Needed Permission | userGroups@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
groupAssignments | User Group assignments to save | |
Return value | - |
SearchAssignableUsers
This method returns all employee profiles that can be associated with the passed type of group.
UserGroupMemberDto[] SearchAssignableUsers(
out TpFault fault,
TpAuthentication authentication,
GroupType groupType,
Guid userGroupId);
Needed Permission | userGroups@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
groupType | Group type for that the user profiles shall be searched | |
userGroupId | Id of the user group that shall be used as a target for the assignable user profiles. | |
Return value | Returns the found user groups |
SearchCoveredUserGroups
This method searches for user groups where the employee has the lead, or is registered at least as an Assistant of the group.
UserGroupDto[] SearchCoveredUserGroups(
out TpFault fault,
TpAuthentication authentication,
UserGroupSearchDto userGroupSearch);
Needed Permission | userGroups@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userGroupSearch | The user group definition to search for | |
Return value | Returns the found user groups |
SearchUserGroupAssignments
This method returns all members of the group to which the profile search fits and agrees with the passed type of group. The data are used primarily for the export of the group.
UserGroupMemberDto[] SearchUserGroupAssignments(
out TpFault fault,
TpAuthentication authentication,
UserSearchDto userSearch,
GroupType groupType);
Needed Permission | userGroups@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userSearch | Use the given user search object to tailor the search results. | |
groupType | Group type for that the user profiles shall be searched | |
Return value | Returns the found user assignments |
SearchUserGroup
This method searches for user groups with the given properties. It can be searched for the group name and the group type.
UserGroupDto[] SearchUserGroups(
out TpFault fault,
TpAuthentication authentication,
UserGroupSearchDto userGroupSearch);
Needed Permission | userGroups@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userGroupSearch | The user group definition to search for | |
Return value | Returns the found user groups |